package com.darren.euc.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "euc_cities")
public class City implements Serializable {

	private static final long serialVersionUID = 2861478466077717714L;

	@Id
	@Column(name = "id")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;

	@Column(name = "city_id")
	private String cityId;
	
	@Column(name = "city_name")
	private String cityName;
	
	//@Transient
	@Column(name = "province_id")
	private String provinceId;
	
	//@ManyToOne(targetEntity = Province.class, fetch = FetchType.EAGER)
	//@JoinColumn(name = "province_id", referencedColumnName = "province_id")
	//private Province province;
	
	@Column(name = "enable", nullable = false, columnDefinition = "int default 1")
	private boolean enable = true;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	
	public String getCityId() {
		return cityId;
	}

	public void setCityId(String cityId) {
		this.cityId = cityId;
	}

	public String getCityName() {
		return cityName;
	}

	public void setCityName(String cityName) {
		this.cityName = cityName;
	}

//	public String getProvinceId() {
//		return (null == province?"":province.getProvinceId());
//	}
//
//	public void setProvinceId(String provinceId) {
//		this.provinceId = provinceId;
//	}
//
//	public Province getProvince() {
//		return null;//province;
//	}
//
//	public void setProvince(Province province) {
//		this.province = province;
//	}

	public String getProvinceId() {
		return provinceId;
	}

	public void setProvinceId(String provinceId) {
		this.provinceId = provinceId;
	}

	public boolean isEnable() {
		return enable;
	}

	public void setEnable(boolean enable) {
		this.enable = enable;
	}
}
